local blaze = require "blaze"
local game = require "club.threecard.texas"

local M = game.ui.element()

M.store_watchers = {
    ingame = {
        ["$"] = blaze.noop,

        ["恢复游戏场景"] = function(self, store, state, args)
            self:update(0)
        end,

        ["奖金池更新"] = function(self, store, state, args)
            self:update(state.current_bonus)
        end
    }
}

function M:ctor()
    self.res = "club.threecard.texas/ui/ingame.b:bonus_pool"
    self.last_value = 0
end

function M:update(to_value)
    game.utility.digit(self.value_txt, self.last_value, to_value, game.i18n.styles.chip2);
    self.last_value = to_value
end

return M